import request from '@/utils/request'
// 获取机构作业范围的属性结构数据
export function getDepartTree() {
  return request({
    url: '/business-hall/tree'
  })
}

// 获取机构详情

export function getDepartDetail(id) {
  return request({
    url: `/business-hall/${id}`
  })
}

// 根据机构id获取用户列表
export function getUserListByDepartId(params) {
  return request({
    url: `/business-hall/user/page`,
    params
  })
}
// 获取城市列表
export function getCityList(params) {
  return request({
    url: `/areas/children`,
    params
  })
}

export function saveDepart(data) {
  return request({
    url: '/business-hall',
    method: 'post',
    data
  })
}

// 获取运费模板
export const transInfo = () => {
  return request({
    url: '/carriages'
  })
}

// 删除运费模板
export const delTransport = (id) => {
  return request({
    url: '/carriages/' + id,
    method: 'delete'
  })
}

// 增加运费魔板
export const addTrans = (data) => {
  return request({
    url: '/carriages',
    method: 'post',
    data
  })
}

// 获取作业范围
export const workarea = (id) => {
  return request({
    url: `/business-hall/scope/${id}/1`,
    method: 'get'
  })
}

// 保存业务范围
export const saveArea = (data) => {
  return request({
    url: '/business-hall/scope',
    method: 'post',
    data
  })
}

// 删除作业范围
export const delWorkarea = (id) => {
  return request({
    url: `/manager/business-hall/scope/${id}/1`
  })
}
